import { Component, OnInit, Input } from '@angular/core';
import { AppGlobalService } from 'src/app/shared/service/app-global.service';

@Component({
  selector: 'app-case-list',
  templateUrl: './case-list.component.html',
  styleUrls: ['./case-list.component.scss'],
})
export class CaseListComponent implements OnInit {
  @Input() tagData: any;

  caseData = [];

  constructor(private appGlobalService: AppGlobalService) { }

  ngOnInit() {
    this.caseData = this.tagData.data.data;
  }

  to(item) {
    if (item) {
      const params = {
        pageId: item.target,
        params: item.params,
        sessionId: localStorage.getItem('sessionId')
      };
      this.appGlobalService.goToForward(params);
    }
  }

}
